<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title><?php echo $view_title?></title>
	<link rel=stylesheet href='./template/<?php echo $OJ_TEMPLATE?>/<?php echo isset($OJ_CSS)?$OJ_CSS:"hoj.css" ?>' type='text/css'>
     <link rel="next" href="submitpage.php?<?php
        
        if ($pr_flag){
		echo "id=$id";
	}else{
		echo "cid=$cid&pid=$pid&langmask=$langmask";
	}
        
        ?>">
</head>
<body>

	<?php
	if(isset($_GET['id']))
		require_once("oj-header.php");
	else
		require_once("contest-header.php");
	
	?>
<div id="wrapper">
<div id=main>
	
	<?php
	
	if ($pr_flag){
		echo "<title>$MSG_PROBLEM $row->problem_id. -- $row->title</title>";
		echo "<center><h2>$id: $row->title</h2>";
	}else{
		$PID="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		echo "<title>$MSG_PROBLEM $PID[$pid]: $row->title </title>";
		echo "<center><h2>$MSG_PROBLEM $PID[$pid]: $row->title</h2>";
	}
	echo "$MSG_Time_Limit:<span class='label label-warning'>$row->time_limit s</span>&nbsp;&nbsp;";
	echo "$MSG_Memory_Limit:<span class='label label-danger'>".$row->memory_limit." MB</span>";
	if ($row->spj) echo "&nbsp;&nbsp;<span class=red>Special Judge</span>";
	//echo "<br><span class=green>$MSG_SUBMIT: </span>".$row->submit."&nbsp;&nbsp;";
	//echo "<span class=green>$MSG_SOVLED: </span>".$row->accepted."<br>"; 
	

	echo "</center>";

	echo "<hr/><h4><strong>$MSG_Description</strong></h4><p><p>".$row->description."</p></p>";
	echo "<hr/><h4><strong>$MSG_Input</strong></h4><p><p>".$row->input."</p></p>";
	echo "<hr/><h4><strong>$MSG_Output</strong></h4><p><p>".$row->output."</p></p>";
	
  
	
	$sinput=str_replace("<","&lt;",$row->sample_input);
  $sinput=str_replace(">","&gt;",$sinput);
	$soutput=str_replace("<","&lt;",$row->sample_output);
  $soutput=str_replace(">","&gt;",$soutput);
	echo "<hr/><h4><strong>$MSG_Sample_Input</strong></h4><p><p><pre>".($sinput)."</pre></p></p>";
	echo "<hr/><h4><strong>$MSG_Sample_Output</strong></h4><p><p><pre>".($soutput)."</pre></p></p>";
		echo "<hr/><h4><strong>$MSG_HINT</strong></h4><p><p>".nl2br($row->hint)."</div></div>";
	
	if ($pr_flag&&!isset($_GET['cid'])) 
		echo "<hr/><h4><strong>标签</strong></h4><p><p>
			<div class=content><p><a href='problemset.php?search=$row->source'>".nl2br($row->source)."</a></p></div></p></p>";
	echo "<center>";
	
if ($pr_flag){
		echo "<a href='submitpage.php?id=$id' class='btn btn-primary'>$MSG_SUBMIT</a>  ";
	}else{
		echo "<a href='submitpage.php?cid=$cid&pid=$pid&langmask=$langmask' class='btn btn-primary'>$MSG_SUBMIT</a>  ";
	}
if (!isset($_GET['cid'])){	
	echo "<a href='problemstatus.php?id=".$row->problem_id."' class='btn btn-primary'>本题排名</a>  ";
	echo "<a href='status.php?problem_id=".$row->problem_id."' class='btn btn-primary'>$MSG_STATUS</a> ";
	echo "<a href='bbs.php?pid=".$row->problem_id."$ucid' class='btn btn-primary'>$MSG_BBS</a> ";
}
	  if(isset($_SESSION['administrator'])){
      require_once("include/set_get_key.php");
      ?>
      [<a href="admin/problem_edit.php?id=<?php echo $id?>&getkey=<?php echo $_SESSION['getkey']?>" >Edit</a>]
      [<a href="admin/quixplorer/index.php?action=list&dir=<?php echo $row->problem_id?>&order=name&srt=yes" >TestData</a>]
      <?php

    }
  echo "</center>";
	?>
<div id=foot>
	<?php require_once("oj-footer.php");?>

</div><!--end foot-->
</div><!--end main-->
</div><!--end wrapper-->
</body>
</html>
